import React from 'react'
import { Router, Route, Switch } from 'dva/router'
import RolePermission from './routes/RolePermission/index'
import AddEmployee from './routes/EmployeeAcount/AddEmployee/index'
import EmployeeAcount from './routes/EmployeeAcount/index'
import propTypes from 'prop-types'
import LoginLog from './routes/LoginLog/index'
import CompanyInfo from './routes/CompanyInfo/index'
import DepartmentManager from './routes/DepartmentManager/index'
import NameVerify from './routes/NameVerify/index'
import EditRole from './routes/RolePermission/EditRole/index'
import CustomerService from './routes/CustomerService/index'
import BrandSet from './routes/BrandSet/index'

function RouterConfig ({ history }) {
  return (
    <Router history={history}>
      <Switch>
        <Route path='/loginLog' component={LoginLog} />
        <Route path='/companyInfo' component={CompanyInfo} />
        <Route exact path='/employeeAcount' component={EmployeeAcount} />
        <Route path='/departmentManager' component={DepartmentManager} />
        <Route path='/nameVerify' component={NameVerify} />
        <Route path='/RolePermission/EditRole' component={EditRole} />
        <Route path='/RolePermission' component={RolePermission} />
        <Route exact path='/employeeAcount/addEmployee/:staffId' component={AddEmployee} />
        <Route path='/customerService' component={CustomerService} />
        <Route path='/brandSet' component={BrandSet} />
      </Switch>
    </Router>
  )
}

RouterConfig.propTypes = {
  history: propTypes.object
}

export default RouterConfig
